package keywords;

/**
 * @author shkstart
 * @date 2022/5/16 - 20:51
 */
public class StaticExer {
    public static void main(String[] args) {
        Circle c1 = new Circle();


        Circle c2 = new Circle();


        Circle c3 = new Circle(3.3);

        System.out.println("c1的id为:" + c1.getId1());
        System.out.println("c2的id为:" + c2.getId1());
        System.out.println("c3的id为:" + c3.getId1());

        System.out.println("创造的圆的对象为:" + Circle.getTotal());
    }
}


class Circle {
    private  int id1;
    private double radius;
    private static int intl = 1001;
    private static int total;

    public Circle() {
        id1 = intl++;
        total++;
    }

    public Circle(double radius) {
        this();
        this.radius = radius;
    }

    public int getId1() {
        return id1;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public static int getTotal() {
        return total;
    }


}
